package cn.gok.restgit.yufa;

import java.util.Arrays;
import java.util.Comparator;

class A{

}

/**
 * @ClassName 数组
 * @Description TODO
 * @Author HP
 * @Date 15:21 2022/7/4
 * @Version 1.0
 **/
public class 数组 {

    public static void main(String[] args) {
        数组初始化();
        数组工具常用方法();

    }

    private static void 数组工具常用方法() {
        Integer a[]={8,4,3,2,7};
        Arrays.sort(a, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        System.out.println();
    }

    private static void 数组初始化() {

        int a[]={1,2,3};
        int a2[] = new int[3];
        a2[0]=1;
        a2[1]=2;
        a2[2]=3;


        A as[] = new A[4];
        for (int i = 0;i<as.length;i++){
            as[i]= new A();
        }
    }
    A bs[]={new A(),new A(),new A(),new A()};

}
